package com.example.zhu.mapper;

import com.example.zhu.vo.LessonVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LessonMapper {

    @Select("select t1.id ,t1.product_id,t1.create_time,t2.package_info,t2.remark,t2.phone from orders t1 , orders_detail t2 where t1.product_id > 2 and t1.product_id < 7 and t1.id = t2.order_id")
    List<LessonVO> selectAll();

    List<LessonVO> getByCondition(String productId, String start, String end);

    @Delete("delete t1, t2 from orders t1,orders_detail t2 where t1.id = t2.order_id and t1.id=#{id}")
    void deleteById(Integer id);
}
